package main

type MyQueue struct {
	stack []int
}

func Constructor() MyQueue {
	return MyQueue{}
}

func (this *MyQueue) Push(x int) {
	var tmp []int
	for i := len(this.stack) - 1; i >= 0; i-- {
		top := this.stack[len(this.stack)-1]
		this.stack = this.stack[0 : len(this.stack)-1]
		tmp = append(tmp, top)
	}
	tmp = append(tmp, x)
	this.stack = nil
	for i := len(tmp) - 1; i >= 0; i-- {
		top := tmp[len(tmp)-1]
		tmp = tmp[0 : len(tmp)-1]
		this.stack = append(this.stack, top)
	}
}

func (this *MyQueue) Pop() int {
	top := this.stack[len(this.stack)-1]
	this.stack = this.stack[0 : len(this.stack)-1]
	return top
}

func (this *MyQueue) Peek() int {
	return this.stack[len(this.stack)-1]
}

func (this *MyQueue) Empty() bool {
	return len(this.stack) == 0
}

func main() {

}
